package top.chenfu.cloud.commons.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Auther chenfu
 * @2019/12/7 20:04
 * @Desc
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResponseData<T> {

    private Integer code;

    private String msg;

    private T data;

    public static ResponseData defaultSuccess() {
        return new ResponseData(200, "success", null);
    }

    public static ResponseData defaultFail() {
        return new ResponseData(500, "fail", null);
    }

    public static ResponseData defaultSuccess(Object data) {
        return new ResponseData(200, "success", data);
    }

}
